home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / dino / dino_bot.1 / examples / helloworld / ex5.d < prev   
Encoding:
Text File  |  1991-03-10  |  986 b   |  42 lines

  1. /* Copyright, 1990, Regents of the University of Colorado */
  2. /* This program prints out messages from two composite procedures which are
  3.  * called in parallel, inside of two different one dimensional environment
  4.  * structures. */
  5.  
  6. #define P1 8
  7. #define P2 6
  8.  
  9. environment node1[P1:id] {
  10.  
  11.   composite part1()
  12.   {
  13.     printf ("node1[%d] says hello from part1()#\n", id);
  14.   }
  15.  
  16. }
  17.  
  18. environment node2[P2:id] {
  19.  
  20.   composite part2()
  21.   {
  22.     printf ("node2[%d] says hello from part2()#\n", id);
  23.   }
  24.  
  25. }
  26.  
  27. environment host {
  28.  
  29.   void main ()
  30.   {
  31.     printf ("host says hello\n");
  32.  
  33.     part1()# :: part2()#;       /* ==> Part1()# and part2()# run in parallel,
  34.                                        through the use of the "::" operator.
  35.                                        These two composite procedures must be
  36.                                        in different environments in order for
  37.                                        the parallelism to work. */
  38.  
  39.     printf ("host says goodby\n");
  40.   }
  41. }
  42.